
<template>
    <Modal
        :title="modalTitle"
        v-model="modal"
        :mask-closable="false"
        :width="500"
        :styles="{top: '90px'}"
        :closable="false"
    >
        <div class="endtime">
            <Form
                ref="exemptPenaltyInterest"
                :model="exemptPenaltyInterest"
                :label-width="150"
                :rules="ruleInline"
            >
                <FormItem label="截止批量豁免日期:" prop="endtime">
                    <DatePicker
                        type="date"
                        format="yyyy-MM-dd"
                        placeholder="请选择"
                        v-model="exemptPenaltyInterest.endtime"
                    ></DatePicker>
                </FormItem>
            </Form>
        </div>

        <div slot="footer">
            <Button type="text" @click="close">取消</Button>
            <Button
                type="primary"
                :loading="submitLoading"
                @click="submit('exemptPenaltyInterest')"
            >提交</Button>
        </div>
    </Modal>
</template>
<script>
export default {
    name: "interestModal",
    props: {
        modalTitle: {
            type: String,
            required: true
        },
        modal: {
            type: Boolean,
            required: true
        }
    },
    data() {
        return {
            exemptPenaltyInterest: {},
            ruleInline: {
                endtime: [
                    {
                        required: true,
                        type: "date",
                        message: "请选择截止豁免日期",
                        trigger: "change"
                    }
                ]
            },
            submitLoading: false
        };
    },
    methods: {
        close() {
            this.submitLoading = false;
            this.$emit("closeModal");
        },
        submit(name) {
            this.$refs[name].validate(valid => {
                if (valid) {
                    this.submitLoading = true;
                    console.log(name, valid);
                }
            });
        }
    },
    computed: {}
};
</script>
